import pandas as pd
import matplotlib.pyplot as plt

# 读取 CSV 文件
filename = 'world_fires_1_day.csv'  # 请确保文件路径正确
data = pd.read_csv(filename)

# 查看数据的前几行，确认数据已正确加载
print(data.head())

# 提取经度、纬度和火灾强度
lon = data['longitude']
lat = data['latitude']
brightness = data['brightness']

# 创建散点图
plt.figure(figsize=(10, 6))
plt.scatter(lon, lat, c=brightness, cmap='hot', alpha=0.5, edgecolors='none')

# 添加颜色条
plt.colorbar(label='Brightness')

# 设置标题和标签
plt.title('Global Fire Locations')
plt.xlabel('Longitude')
plt.ylabel('Latitude')

# 显示图形
plt.show()
